package com.tsin.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tsin.usercenter.common.BaseResponse;
import com.tsin.usercenter.model.Team;
import com.tsin.usercenter.model.User;
import jakarta.servlet.http.HttpServletRequest;

import java.util.List;

import static com.tsin.usercenter.constant.UserConstant.ADMIN_ROLE;
import static com.tsin.usercenter.constant.UserConstant.USER_LOGIN_KEY;

/**
 * @author Miles
 * @description 针对表【user】的数据库操作Service
 * @createDate 2023-08-10 20:45:52
 */
public interface UserService extends IService<User> {


    /**
     * 用户注册
     *
     * @param userAccount   用户账户
     * @param userPassword  用户密码
     * @param checkPassword 验证码
     * @return 用户id
     */
    long userRegister(String userAccount, String userPassword, String checkPassword);

    Long userDoLogin(String userAccount, String userPassword, HttpServletRequest httpServletRequest);

    User getSafetyUser(User user);

    int  userLoginOut(HttpServletRequest httpServletRequest);

    List<User> searchUserByTagsBySql(List<String> tagsList);
    List<User> searchUserByTags(int pageSize,int pageNum,List<String> tagsList);
    //更新用户信息
    Integer updateUser(User user,User loginUser);

    User getLoginUser(HttpServletRequest httpServletRequest);

    /**
     * 是否为管理员
     *
     * @param
     * @return
     */
    boolean isAdmin(HttpServletRequest httpServletRequest);

    boolean isAdmin(User loginUser);

    List<User> matchUsers(long num, User loginUser);

}
